package com.yswy.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yswy.app.dto.LogRecordVo;
import com.yswy.app.service.LogRecordService;
import com.yswy.domain.entity.log.LogRecord;
import com.yswy.domain.mapper.LogRecordMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Date;


@Slf4j
@Service
public class LogRecordServiceImpl extends ServiceImpl<LogRecordMapper, LogRecord>
        implements LogRecordService {


    @Override
    public void addLogRecord(LogRecordVo logRecordVo , Long userId) {
        save(LogRecord.builder()
                .createTime(new Date())
                .userId(userId)
                .recordName(logRecordVo.getRecordName())
                .recordWord(logRecordVo.getRecordWord())
                .appendInformation(logRecordVo.getAppendInformation())
                .build());
    }
}
